################################################################################
# execute thsi scrite after you do ceph-deploy activate
#
# usage: ./write-fstab.sh sdb1
################################################################################
#!/bin/shA

partions="b c d" 
dev=$1
for p in $partions; do
	echo sd${p}
	echo /dev/sd${p}1
	echo UUID=`blkid /dev/sd${p}1 |cut -d : -f 2|cut -d " " -f 2|cut -d \" -f 2` `mount | grep sd${p} | awk '{print $3 " " $5 " " $NF}' | tr -d "(" | tr -d ")"` 0 0 >> /etc/fstab
done

partions_nvme="nvme0n1p1 nvme1n1p1"
for p in $partions_nvme; do
        echo ${p}
        echo /dev/${p}
        echo UUID=`blkid /dev/${p} |cut -d : -f 2|cut -d " " -f 2|cut -d \" -f 2` `mount | grep ${p} | awk '{print $3 " " $5 " " $NF}' | tr -d "(" | tr -d ")"` 0 0 >> /etc/fstab
done
